package com.ms.p2p.provider.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.ms.common.utils.PageData;
import com.ms.p2p.bean.PageBean;
import com.ms.p2p.entity.Page;
import com.ms.p2p.entity.content.Article;
import com.ms.p2p.provider.ArticleProvider;
import com.ms.p2p.service.impl.ArticleServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * Created by daimajia on 2015/4/19 添加dubbo接口.
 */
@Service
public class ArticleProviderImpl implements ArticleProvider {
    @Autowired
    ArticleServiceImpl   articleService;

    public int insert(Article article) {
        return articleService.insert(article);
    }

    public int update(Article article) {
        return articleService.update(article);
    }

    public int delete(int id) {
        return articleService.delete(id);
    }

    public Article get(String id) {
        return articleService.get(id);
    }

    public List<Article> getNewsNoticesPage(PageBean page, String title, String author, String status, String type, String issueDate_begin, String issueDate_end) {
        return articleService.getNewsNoticesPage(page,title,author,status,type,issueDate_begin,issueDate_end);
    }

    public int selectNewsNoticesCount(String title, String author, String status, String type, String issueDate_begin, String issueDate_end) {
        return articleService.selectNewsNoticesCount(title,author,status,type,issueDate_begin,issueDate_end);
    }

    public List<Article> getIndexNotice(int type, PageBean page) {
        return articleService.getIndexNotice(type,page);
    }

    public List<Article> findPager(int classid, String status, PageBean page) {
        return articleService.findPager(classid,status,page);
    }

    public int findCount(int classid, String status) {
        return articleService.findCount(classid,status);
    }

   

    public Page listAll(Page pages) {
      List<PageData> pageDataList = articleService.listAll(pages);
        pages.setList(pageDataList);
        return pages;
    }
}
